<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            list-style: none;
            padding: 0;
            margin: 0;
        }
        .box{
            width: 400px;
            height: 350px;
            border: 1px solid #ccc;
            margin: 0 auto;
        }
        ol{
            width: 100%;
            height: 50px;
            margin-bottom: 20px;
            
        }
        ol>li{
            width: 100px;
            height: 50px;
            float: left;
            background-color: skyblue;
            text-align: center;
            line-height: 50px;
            list-style: 50px;
            margin: 0 10px;
            cursor: pointer;
        }
      
        ul>li{
            width: 100%;
            height: 300px;
            text-align: center;
            line-height: 300px;
            display: none;
          
        }
        .active{
            display: block;
            background-color: pink;
        }
    </style>
</head>
<body>
  <div class="box">
    <ol>
        <li class="active">1</li>
        <li>2</li>
        <li>3</li>
    </ol>
     <ul>
       
         <li class="active">1</li>
         <li>2</li>
         <li>3</li>
     </ul>
  </div>
</body>
<script>
    var olis=document.querySelectorAll("ol>li")
    var ulis=document.querySelectorAll("ul>li")
    for(let i=0;i<olis.length;i++){
        olis[i].onclick=()=>{
            for(var j=0;j<ulis.length;j++){
               ulis[j].className=''
               olis[j].className=''
           }
           ulis[i].className=olis[i].className='active'
        }
    }
</script>
</html>